home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Resource for Source: C/C++
/
Resource for Source - C-C++.iso
/
codelib6
/
v_08_06
/
8n06024a
< prev
next >
Wrap
Text File
|
1995-11-01
|
405b
|
28 lines
*****Listing 1*****
#include <stdio.h>
#include <stdlib.h>
main()
{
FILE *out, *tmp;
char ch;
printf("Enter A (abort), E (exit): ");
ch = getchar();
tmp = tmpfile();
fwrite("abcdefgh\n", 1, 9, tmp);
out = fopen("TEST.DAT", "w");
fprintf(out, "message to data file\n");
fprintf(stderr, "error message to stderr\n");
if (ch == 'A')
abort();
else
exit(0);
}